package com.jianganming.observer.demo2;

import com.jianganming.observer.demo.Observer;
import com.jianganming.observer.demo.Subject;

//Observer 自定义观察者接口
//观察者对象，
public class Student implements Observer {
    private String name;

    public Student(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void response(Subject subject) {
        System.out.println("收到"+subject.getName()+"的通知");
        System.out.println(name+"说：好的，我马上到。");

    }
}
